Function: value<
value< is a byte-compiled function defined in compat-30.el.
Signature
(value< A B)
Documentation
[Compatibility function for value<, defined in Emacs 30.1. See (compat) Emacs
30.1' for more details.]
Return non-nil if A precedes B in standard value order. A and B must have the same basic type. Numbers are compared with <. Strings and symbols are compared with string-lessp. Lists, vectors, bool-vectors and records are compared lexicographically. Markers are compared lexicographically by buffer and position. Buffers and processes are compared by name. Other types are considered unordered and the return value will be ‘nil’.
Source Code
;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-30.el
;;;; Defined in fns.c
(compat-defun value< (a b) ;; <compat-tests:value<>
"Return non-nil if A precedes B in standard value order.
A and B must have the same basic type.
Numbers are compared with <.
Strings and symbols are compared with string-lessp.
Lists, vectors, bool-vectors and records are compared lexicographically.
Markers are compared lexicographically by buffer and position.
Buffers and processes are compared by name.
Other types are considered unordered and the return value will be ‘nil’."
(cond
((or (and (numberp a) (numberp b))
(and (markerp a) (markerp b)))
(< a b))
((or (and (stringp a) (stringp b))
(and (symbolp a) (symbolp b)))
(string< a b))
((and (listp a) (listp b))
(while (and (consp a) (consp b) (equal (car a) (car b)))
(setq a (cdr a) b (cdr b)))
(cond
((not b) nil)
((not a) t)
((and (consp a) (consp b)) (value< (car a) (car b)))
(t (value< a b))))
((and (vectorp a) (vectorp b))
(let* ((na (length a))
(nb (length b))
(n (min na nb))
(i 0))
(while (and (< i n) (equal (aref a i) (aref b i)))
(cl-incf i))
(if (< i n) (value< (aref a i) (aref b i)) (< n nb))))
((and (bufferp a) (bufferp b))
;; `buffer-name' is nil for killed buffers.
(setq a (buffer-name a)
b (buffer-name b))
(cond
((and a b) (string< a b))
(b t)))
((and (processp a) (processp b))
(string< (process-name a) (process-name b)))
;; TODO Add support for more types here.
;; Other values of equal type are considered unordered (return value nil).
((eq (type-of a) (type-of b)) nil)
;; Different types.
(t (error "value< type mismatch: %S %S" a b))))